package Month11.Day24;

import java.io.*;
import java.net.Socket;
import java.util.Scanner;

public class Test1 {
    public static void main(String[] args) {
        try {
            Socket socket=new Socket("localhost",9999);
            InputStream in=socket.getInputStream(); 
            OutputStream out=socket.getOutputStream();
            BufferedReader br=new BufferedReader(new InputStreamReader(in));
            PrintWriter pw=new PrintWriter(out,true);
            Scanner input=new Scanner(System.in);
            System.out.println("请输入账号密码");
            String ID=input.next();
            String password=input.next();
            pw.println(ID);
            pw.println(password);
            String reply=br.readLine();
            System.out.println("服务器："+reply);
            socket.close();
        } catch (IOException e) {
            e.printStackTrace();
        }


    }

}
